﻿<?php

//page define 
$_common['title'] = "创软图书馆 | 书是人类进步的阶梯";
$_common['page'] = "home";
$_common['localpath'] = '.';

require($_common['localpath'] . '/content/header.php');
// get book info API
require($_common['localpath'] . '/include/class_com_bookapi.php');
require($_common['localpath'] . '/data/class_book_post.php');

?>
	<div id="section">
		<ul class="book_list">
		<?php 
			$book = new isa_book_post("", "", "", "", "", "");
			$booklist = $book->GetBooks();
			for($i = 0; $i < $booklist->num_rows; $i++)
			{
				$row = $booklist->fetch_assoc();
				$dbinfo = $BookInfo->getById($row["book_douban"]);
				$html = <<<HTML
			<li class="book_item">
				<a href="http://book.douban.com/subject/{$row["book_douban"]}/" class="book_img"><img src="{$dbinfo['images']['large']}" alt="{$dbinfo['title']}"/></a>
				<div class="book_desc">
					<h2 class="t_over title"><a href="http://book.douban.com/subject/{$row["book_douban"]}/" title="{$dbinfo['title']}" target="_blank">{$dbinfo['title']}</a></h2>
					<p>作者:  {$dbinfo['author'][0]}</p>
					<p>出版社: {$dbinfo['publisher']}</p>
					<p>页数: {$dbinfo['pages']}</p>
					<p>
						<a href="#{$row["book_douban"]}" class="pending" title="尚未支持">在库</a>
						<a href="{$row["book_url"]}" class="ebook">电子书</a>
					</p>
				</div>
			</li>
HTML;
			echo $html;
			}
		?>
		</ul>
	</div>
<?php 
require($_common['localpath'] . '/content/footer.php');
?>